package vip.xiaonuo.bi.modular.datasource.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import vip.xiaonuo.bi.modular.datasource.doris.ExampleTbl;

import java.util.List;
import java.util.Map;

/**
 * doris sql执行动态定制Mapper接口
 *
 * @author 顾育司
 * @date  2023/12/15 12:09
 **/

@Mapper
public interface EXampleTblMapper extends BaseMapper<ExampleTbl> {

    /**
     * ddl操作
     * @param sql
     */
    @InterceptorIgnore(tenantLine = "true")
    @Update("${sql}")
    void exeDDLsql(@Param("sql") String sql);

    /**
     * 查询操作
     * @param sql
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
//    @CancelCamelCase 待补
    @Select("${sql}")
    List<Map<String, Object>> exeQuerySql(@Param("sql") String sql);

}